{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "042ca1eb-76c6-4f17-9d94-d1ef2c16b8ee",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Linear模型的预测准确率为:0.78363\n",
      "Ridge模型的预测准确率为:0.78905\n",
      "Lasso模型的预测准确率为:0.66948\n",
      "Linear模型的最大预测准确率为:0.78363\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZwAAAE1CAYAAADTUlYfAAAAOnRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjEwLjAsIGh0dHBzOi8vbWF0cGxvdGxpYi5vcmcvlHJYcgAAAAlwSFlzAAAPYQAAD2EBqD+naQAAG9NJREFUeJzt3X1QlXX+//HXEeWgJqixcWPEUm2JoZawkiC1s0u0rmsxdkNOoZXd6NoG2pSwpPa1lLKbWVcDs7WcJi3GNLtZbDzdaDq6aURtq25mohAeZHV2z2FjE4XP749+ntkTUB6Ez0F8PmauP/ic67rO+5qdPc+u4zngMMYYAQDQxXoFewAAwNmB4AAArCA4AAArCA4AwAqCAwCwguAAAKwgOAAAKwgOAMAKggMAsILgAKdo5cqVcjgc+vjjj9t8/MCBA3I4HFq5cqXdwYAzRO9gDwD0FDExMdq+fbsuuuiiYI8CdEsEB+gkTqdTV155ZbDH+EGNjY3q169fsMfAWYq31IBO0tZbao888ogcDod27dqlSZMmKSIiQlFRUbrzzjvl8Xj8jjfGqKSkRJdffrn69u2rQYMG6cYbb9T+/fv99nO5XLr++ut1/vnnKywsTBdffLHuvfdeHTlyxG+/k8/9ySef6MYbb9SgQYO4+0JQERzAghtuuEGXXHKJ1q5dq4KCAq1evVozZ8702+fee+9Vfn6+MjMztX79epWUlGjXrl1KS0vT4cOHfft99dVXGjNmjEpLS7Vx40bNnTtXH330kcaOHavjx4+3eu6JEyfq4osv1po1a7Rs2bIuv1agXQbAKXnxxReNJLNz5842H6+qqjKSzIsvvuhbmzdvnpFkFi1a5Lfv7373OxMWFmZaWlqMMcZs377dSDJPP/203341NTWmb9++5qGHHmrzOVtaWszx48fNwYMHjSTzxhtvtHruuXPnduRygU7HHQ5gwXXXXef384gRI/Ttt9+qvr5ekvT222/L4XDotttu04kTJ3xbdHS0Ro4cqU2bNvmOra+v17Rp0xQXF6fevXurT58+io+PlyTt2bOn1XPfcMMNXXdhQAD40ABgwbnnnuv3s9PplCT997//lSQdPnxYxhhFRUW1efyFF14oSWppaVFWVpYOHTqkOXPmaPjw4erfv79aWlp05ZVX+s73v2JiYjrzUoAOIzhANxAZGSmHw6EtW7b4YvS/Tq79/e9/12effaaVK1dqypQpvsf37dvX7rkdDkfnDwx0AMEBuoHf/va3evzxx1VbW6ubb7653f1OxuP7UXruuee6dD6gMxAcIEDvv/++Dhw40Gp92LBhHT5nenq67rnnHt1xxx36+OOPddVVV6l///5yu93aunWrhg8frunTp2vo0KG66KKLVFBQIGOMBg8erLfeeksul+s0rgiwg+AAAZo9e3ab61VVVad13ueee05XXnmlnnvuOZWUlKilpUWxsbFKT0/X6NGjJUl9+vTRW2+9pby8PN17773q3bu3MjMz9e677+qCCy44recHuprDGGOCPQQAoOfjY9EAACsIDgDACoIDALCC4AAArCA4AAArCA4AwIoe8z2clpYWHTp0SAMGDOBXeQCARcYYNTQ0KDY2Vr16tX8f02OCc+jQIcXFxQV7DAA4a9XU1Oj8889v9/EeE5wBAwZI+u6Cw8PDgzwNAJw9vF6v4uLifK/D7ekxwTn5Nlp4eDjBAYAg+LF/zuBDAwAAKwgOAMAKggMAsILgAACsIDgAACsIDgDACoIDALCC4AAArCA4AAArCA4AwAqCAwCwguAAAKzoUHBKSkqUkJCgsLAwJScna8uWLT+4/6pVqzRy5Ej169dPMTExuuOOO3T06FHf488//7wyMjI0aNAgDRo0SJmZmdqxY0dHRgMAdFMBB6esrEz5+fkqKipSZWWlMjIyNG7cOFVXV7e5/9atWzV58mRNnTpVu3bt0po1a7Rz507dddddvn02bdqk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mTJgV7tC518vWnrdemgwcPBmOkTnFWB+ek7/85A2NMh/7EwZnivvvu09/+9jdt3bo12KN0qpqaGuXl5Wnjxo0KCwsL9jhdqqWlRSkpKVq4cKEk6YorrtCuXbtUWlrao4JTVlaml19+WatXr9Zll12mTz/9VPn5+YqNjdWUKVOCPV6X62mvTWd1cCIjIxUSEtLqbqa+vr7Vf1n0FL///e/15ptv6sMPP+yUP+fQnVRUVKi+vl7Jycm+tebmZn344YdaunSpjh07ppCQkCBO2HliYmI0bNgwv7XExEStXbs2SBN1jQcffFAFBQW65ZZbJEnDhw/XwYMHVVxc3KODEx0dLem7O52YmBjf+pn+2nRW/xtOaGiokpOT5XK5/NZdLpfS0tKCNFXXMMbovvvu07p16/T+++8rISEh2CN1ul/96lf6/PPP9emnn/q2lJQU3Xrrrfr00097TGwkKT09vdXH2vfu3av4+PggTdQ1GhsbW/1Br5CQkB7xsegfkpCQoOjoaL/XpqamJm3evPnMfm0K7mcWgu/VV181ffr0MStWrDC7d+82+fn5pn///ubAgQPBHq1TTZ8+3URERJhNmzYZt9vt2xobG4M9WpfqqZ9S27Fjh+ndu7dZsGCB+fLLL82qVatMv379zMsvvxzs0TrVlClTzJAhQ8zbb79tqqqqzLp160xkZKR56KGHgj3aaWtoaDCVlZWmsrLSSDLPPPOMqaysNAcPHjTGGPP444+biIgIs27dOvP555+bSZMmmZiYGOP1eoM8eced9cExxphnn33WxMfHm9DQUDNq1Kge+VFhSW1uL774YrBH61I9NTjGGPPWW2+ZpKQk43Q6zdChQ83y5cuDPVKn83q9Ji8vz1xwwQUmLCzMXHjhhaaoqMgcO3Ys2KOdtg8++KDN/09OmTLFGPPdR6PnzZtnoqOjjdPpNFdddZX5/PPPgzv0aeLPEwAArDir/w0HAGAPwQEAWEFwAABWEBwAgBUEBwBgBcEBAFhBcAAAVhAcAIAVBAcAYAXBAQBYQXAAAFYQHACAFf8PTOl76/rKNLQAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 1000x700 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Ridge模型的最大预测准确率为:0.78905\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAR4AAADoCAYAAAA5dYtmAAAAOnRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjEwLjAsIGh0dHBzOi8vbWF0cGxvdGxpYi5vcmcvlHJYcgAAAAlwSFlzAAAPYQAAD2EBqD+naQAAG09JREFUeJzt3X9UVHX+P/DnOMwMijiiJjMkErYLhKZrsKioYZthrlmerRXaFn+s7kprm+SeCo8l/VChH6c2O2JHFlFPmq4i1SlSaQPS0DKW3S0x0xTBZCTYdaClQOD1+aMv8+06A3EJ3wP6fJxzz2ne83pfXvfGfXrnXmbGICICIiKF+nm7ASK6+jB4iEg5Bg8RKcfgISLlGDxEpByDh4iUY/AQkXIMHiJSjsFDRMoxeEi3zZs3w2AwuBYfHx/Y7XYkJibixIkTmtpp06Zh2rRpP7jOiooKGAwGbN68+fI0Tb2Kj7cboL4rJycHERER+Pbbb/HBBx9gzZo1KCwsxGeffYaAgAAAQGZmppe7pN6IwUPdNmbMGERHRwP47symtbUVaWlpeP3117Fw4UIAQGRkpDdbpF6KL7Wox7SH0Pnz511jnl5qnTt3DnPnzoW/vz+sVisSEhLgcDg8rjMrKwthYWGwWCyIjIzE9u3bsWDBAlx33XWauubmZqxevRoRERGwWCy45pprsHDhQnz11Vc9uo3UM3jGQz3m9OnTAICwsLAOa7755htMnz4d586dQ3p6OsLCwvD2228jISHBrXbjxo1YsmQJ7r77brz44otwOp148skn0dTUpKlra2vDXXfdhQMHDuCRRx5BbGwszpw5g7S0NEybNg0ff/wx+vfv37MbSz+OEOmUk5MjAOTw4cNy8eJFaWhokL1794rNZpObb75ZLl686KqNi4uTuLg41+MNGzYIAHnjjTc06/z9738vACQnJ0dERFpbW8Vms8mECRM0dWfOnBGTySQhISGusdd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suFi9erHuut/d5+x1EPb/z7fP0zulJV1TwmM1mREVFoaCgQDNeUFCA2NhYj3MmTZrkVr9//35ER0fDZDJdtl6/T0TwwAMPYM+ePXjvvfcQGhrarfWUlZXBbrf3cHf6NDU14dixYx320Rv296VycnIwfPhwzJo1S/dcb+/z0NBQ2Gw2zT5tbm5GcXFxh7/zQMf/Hzqb06OUXMJWqP12enZ2tpSXl0tKSor4+flJRUWFiIikpqZKUlKSq7799u5DDz0k5eXlkp2drfz27v333y9Wq1WKioo0t2kbGxtdNZf2/eKLL0peXp58/vnn8umnn0pqaqoAkNzcXGV9i4j8+c9/lqKiIjl16pQcPnxY7rjjDvH39+/V+/v7WltbZeTIkfLoo4+6Pddb9nlDQ4OUlZVJWVmZAJAXXnhBysrKXH8ikpGRIVarVfbs2SOffPKJ3HvvvW6305OSkjR3dj/44AMxGo2SkZEhx44dk4yMDN5O/7HWr18vISEhYjab5aabbtLclp4/f77ExcVp6ouKimT8+PFiNpvluuuukw0bNijtF4DHJScnp8O+n3nmGbn++uvF19dXAgICZMqUKfL2228r7VtEXH8zYjKZJCgoSH71q1/J0aNHO+xbxPv7+/v27dvn+tucS/WWfd5+G//SZf78+SLy3S31tLQ0sdlsYrFY5Oabb5ZPPvlEs464uDhXfbtdu3ZJeHi4mEwmiYiIUPqPFj8Wg4iUu6Ku8RBR38DgISLlGDxEpByDh4iUY/AQkXIMHiJSjsFDRMoxeIhIOQYPESnH4CEi5Rg8RKQcg4eIlPs/2G8+5J75WRIAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Lasso模型的最大预测准确率为:0.66948\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAR4AAADoCAYAAAA5dYtmAAAAOnRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjEwLjAsIG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ot1gsUlpaKunp6eLt7S0VFRUiIpKZmSmpqan2+rbLuy+++KKUlpaKxWJRfnn3+eefF5PJJIcOHXK4TNvY2Givub3vt956SwoKCuTMmTNy8uRJyczMFACSl5enrG8RkZdeekkOHTok5eXlcvToUXnyySfFx8enT2/v72ttbZURI0bI7373u3bP9ZVt3tDQIMePH5fjx48LAFmzZo0cP37c/hGRnJwcMZlMkp+fLydOnJCf//zn7S6np6amOlzZ/eSTT8Td3V1ycnKkrKxMcnJyeDn9f7Vu3ToJDg4WvV4vEyZMcLgsnZaWJnFxcQ71hw4dkvHjx4ter5f77rtP1q9fr7RfAE4fmzZt6rDvN998U0JDQ8VoNMrdd98tU6ZMkQ8//FBp3yJi/8yIp6enBAYGypw5c+TUqVMd9i3i+u39ffv27bN/Nud2fWWbt13Gv/2RlpYmIt9dUs/KypJhw4aJwWCQqVOnyokTJxyWERcXZ69vs3PnTgkLCxNPT08JDw9X+j8t/iwGESk3oM7xEFH/wOAhIuUYPESkHIOHiJRj8BCRcgweIlKOwUNEyjF4iEg5Bg8RKcfgISLlGDxEpByDh4iU+z9MrCkFSq44KAAAAABJRU5ErkJggg==",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "data_ur1=\"http://lib.stat.cmu.edu/datasets/boston\"\n",
    "raw_df=pd.read_csv(data_ur1,sep=\"\\s+\",skiprows=22,header=None)\n",
    "data=np.hstack([raw_df.values[::2,:],raw_df.values[1::2,:2]])\n",
    "target=raw_df.values[1::2,2]\n",
    "x,y=data,target\n",
    "\n",
    "from sklearn.linear_model import LinearRegression,Ridge,Lasso\n",
    "from sklearn.model_selection import train_test_split\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "x_train,x_test,y_train,y_test=train_test_split(x,y,random_state=1,test_size=0.3)\n",
    "lr=LinearRegression()\n",
    "rd=Ridge()\n",
    "ls=Lasso()\n",
    "models=[lr,rd,ls]\n",
    "names=['Linear','Ridge','Lasso']\n",
    "\n",
    "for model,name in zip(models,names):\n",
    "    model.fit(x_train,y_train)\n",
    "    score=model.score(x_test,y_test)\n",
    "    print(\"%s模型的预测准确率为:%.5f\"%(name,score))\n",
    "    \n",
    "scores=[]\n",
    "alphas=[0.0001,0.0005,0.001,0.005,0.01,0.05,0.1,0.5,1,5,10,50]\n",
    "for index,model in enumerate(models):\n",
    "    scores.append([])\n",
    "    for alpha in alohas:\n",
    "        if index>0:\n",
    "            model.aloha=alpha\n",
    "        model.fit(x_train,y_train)\n",
    "        scores[index].append(model.score(x_test,y_test))\n",
    "        \n",
    "fig=plt.figure(figsize=(10,7))\n",
    "for i ,name in enumerate(names):\n",
    "    plt.subplot(2,2,i+1)\n",
    "    plt.plot(range(len(alphas)),scores[i],'g-')\n",
    "    plt.title(name)\n",
    "    print('%s模型的最大预测准确率为:%.5f'%(name,max(scores[i])))\n",
    "    plt.show()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
